#include <linux/clockchips.h>
#include <linux/percpu.h>

#include "inc/tick.h"
#include "inc/timekeeping.h"

static void tick_periodic(int cpu)
{
    if (cpu == 0)
    {
        jiffies_increase(1);
    }

    update_process_times(0);
}

void tick_handle_periodic(struct clock_event_device *dev)
{
    int cpu = smp_processor_id();

    tick_periodic(cpu);
}

void tick_check_new_device(struct clock_event_device *newdev)
{
    newdev->event_handler = tick_handle_periodic;
}
